﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class LoginPanel : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string user = Session["name_user"] as string;
        if (String.IsNullOrEmpty(user))
        {
            lblHello.Visible = false;
            HeadLoginName.Visible = false;
            btnExit.Visible = false;
            HeadLoginStatus.Visible = true;
        }
        else
        {
            HeadLoginStatus.Visible = false;
            lblHello.Visible = true;
            btnExit.Visible = true;
            HeadLoginName.Visible = true;
            HeadLoginName.Text = Session["name_user"].ToString();
            HeadLoginName.NavigateUrl = "~/ThongTinCaNhan.aspx?Type=ThongTin";
        }
    }
    protected void btnExit_Click(object sender, EventArgs e)
    {
        Session["user"] = "";
        Session["name_user"] = "";
        Response.Redirect("~/Index.aspx");
    }
}